<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../static/js/axios.js"></script>
    <link rel="shortcut icon" href="../static/imgs/cms.png" type="image/x-icon">
    <title>重置密码</title>
    <link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../static/css/ForgetPwd.css">
    <link rel="stylesheet" type="text/css" href="../static/css/ManagerLogin.css">
    <script src="../static/js/jQuery.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="input-box">
    <div class="title-box">
        管理员登录
    </div>
    <div class="info-box">
        <div class="info-title">
            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
            &nbsp;账号
        </div>
        <div class="info-input">
            <label>
                <input type="text" id="input-pwd" placeholder="请输入管理员账号">
            </label>
        </div>
    </div>
    <div class="info-box">
        <div class="info-title">
            <span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
            &nbsp;密码
        </div>
        <div class="info-input">
            <label>
                <input type="password" id="input-confirm" placeholder="请确认密码">
            </label>
        </div>
    </div>
    <div class="info-box">
        <div class="confirm-btn-box">
            <button class="confirm-btn">登录</button>
        </div>
    </div>
    <div class="return-login-box">
        <a href="#" class="return-login-btn">返回用户登录界面</a>
    </div>

</div>
<script>
    let interval;
    $(function () {

    })
    /*管理员登录*/
    $(".confirm-btn").click(function () {
        let url='http://localhost:8080/userServlet?action=manager_login'
        axios({
            method:'GET',
            url:url,
            params:{
                username:$("#input-pwd").val(),
                password:$("#input-confirm").val()
            },
        }).then(function (res) {
              console.log(res);
              if(res['data']['code']===200){
                  alert(res['data']['message']);
                  location.href="ManagePage.html";
              }else{
                   alert(res['data']['message']);
              }
        })
    })

    /*返回登录界面*/
    $(".return-login-btn").click(function () {
          location.href="login.html";
    })
</script>
</body>
</html>